﻿package yii.base{

	import flash.utils.*;

	public class CComponent{





	/**
	 * Attaches a behavior to this component+
	 * This method will create the behavior object based on the given
	 * configuration+ After that, the behavior object will be initialized
	 * by calling its {@link IBehavior::attach} method+
	 * @param string $name the behavior's name+ It should uniquely identify this behavior+
	 * @param mixed $behavior the behavior configuration+ This is passed as the first
	 * parameter to {@link YiiBase::createComponent} to create the behavior object+
	 * @return IBehavior the behavior object
	 * @since 1+0+2
	 */
	public function attachBehavior($name,$behavior){
		trace( "attachBehaviorは未実装です" );
	}



	/**
	 * Attaches a list of behaviors to the component+
	 * Each behavior is indexed by its name and should be an instance of
	 * {@link IBehavior}, a string specifying the behavior class, or an
	 * array of the following structure:
	 * <pre>
	 * array(
	 *     'class'=>'path+to+BehaviorClass',
	 *     'property1'=>'value1',
	 *     'property2'=>'value2',
	 * )
	 * </pre>
	 * @param array $behaviors list of behaviors to be attached to the component
	 * @since 1+0+2
	 */
	public function attachBehaviors($behaviors):void{
		for( var $name in $behaviors ){
			var $behavior = $behaviors[$name];
			this.attachBehavior($name,$behavior);
		}
	}






	}
}